﻿<%
'先定义
Dim PI_ID		
Dim PI_Title	
Dim PI_Desc                
Dim PI_Type		
Dim PI_Area                
                
Dim PI_Link		
Dim PI_Address	
Dim PI_Tel		
Dim PI_Email	
Dim PI_Website	
Dim PI_QQ		
                
                
Dim PI_IsAudit	
Dim PI_IsTop	
Dim PI_IP		
                

Dim Update_Name		
Dim Update_Date		

Sub Get_Data()
	PI_Title	= reform("PI_Title")	
	PI_Desc		= reform("PI_Desc")                
	PI_Type		= reform("PI_Type")		
	PI_Area		= reform("PI_Area")                
				
	PI_Link		= reform("PI_Link")		
	PI_Address	= reform("PI_Address")	
	PI_Tel		= reform("PI_Tel")		
	PI_Email	= reform("PI_Email")	
	PI_Website	= reform("PI_Website")	
	PI_QQ		= reform("PI_QQ")	
	
	Update_Name	= Session("Admin_UserName")
	Update_Date	= now()
	
End Sub 

Sub Person_Info_Add()
	Call Get_Data()

	Sql = "INSERT INTO Person_Info ( "&_
			"PI_Title"&_	
			",PI_Desc"&_                
			",PI_Type"&_		
			",PI_Area"&_                
						
			",PI_Link"&_		
			",PI_Address"&_	
			",PI_Tel"&_		
			",PI_Email"&_	
			",PI_Website"&_	
			",PI_QQ"&_		
			",Update_Name"&_		
			",Update_Date"&_
			")VALUES("&_
			"'"&PI_Title&"'"&_	
			",'"&PI_Desc&"'"&_                
			",'"&PI_Type&"'"&_		
			",'"&PI_Area&"'"&_                
						
			",'"&PI_Link&"'"&_		
			",'"&PI_Address&"'"&_	
			",'"&PI_Tel&"'"&_		
			",'"&PI_Email&"'"&_	
			",'"&PI_Website&"'"&_	
			",'"&PI_QQ&"'"&_		
			",'"&Update_Name&"'"&_		
			",'"&Update_Date&"'"&_
			")"
	conn.execute(sql)

	AlertBox "增加成功！","Person_Info_Query.asp"

End Sub 
Sub Person_Info_Edit()
	PI_ID = Reform("PI_ID")
	Call Check_IsNumeric(PI_ID)
	Call Get_Data()

	Sql = "UPDATE Person_Info SET "&_
		"PI_Title='"&PI_Title&"'"&_
		",PI_Desc='"&PI_Desc&"'"&_            
		",PI_Type='"&PI_Type&"'"&_
		",PI_Area='"&PI_Area&"'"&_           
					
		",PI_Link='"&PI_Link&"'"&_
		",PI_Address='"&PI_Address&"'"&_
		",PI_Tel='"&PI_Tel&"'"&_
		",PI_Email='"&PI_Email&"'"&_
		",PI_Website='"&PI_Website&"'"&_
		",PI_QQ='"&PI_QQ&"'"&_
		",Update_Name='"&Update_Name&"'"&_
		",Update_Date='"&Update_Date&"'"&_
		" WHERE PI_ID="&PI_ID
    conn.execute(sql)

	AlertBox "修改成功！","Person_Info_Query.asp"

End Sub 
Sub Person_Info_Del()

	Info_ID = Reform("OP_ID")
	
	sql = "DELETE FROM  Person_Info WHERE PI_ID IN ( "&Info_ID &")"

    conn.execute(sql)

	AlertBox "删除成功","Person_Info_Query.asp"

End Sub 
Sub Get_Info()	
	PI_ID = requery("PI_ID")

	Call Check_IsNumeric(PI_ID)

	sql = "SELECT * FROM Person_Info WHERE PI_ID = " &PI_ID
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		PI_ID		= rs("PI_ID")		
		PI_Title	= rs("PI_Title")
		PI_Desc		= rs("PI_Desc")
						
		PI_Type		= rs("PI_Type")		
		PI_Area		= rs("PI_Area")		
						
						
		PI_Link		= rs("PI_Link")		
		PI_Address	= rs("PI_Address")	
		PI_Tel		= rs("PI_Tel")		
		PI_Email	= rs("PI_Email")	
		PI_Website	= rs("PI_Website")	
		PI_QQ		= rs("PI_QQ")		
						
						
		PI_IsAudit = rs("PI_IsAudit")	
		PI_IsTop	= rs("PI_IsTop")	
		PI_IP		= rs("PI_IP")		
						
		Update_Name = rs("Update_Name")
		Update_Date = rs("Update_Date")
	End If

End Sub 
%>


